<UserControl
    x:Class="WPFExcelReport.VKPLIST"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
 >
    <UserControl.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <CollectionViewSource  x:Key="vwVKPOS" Source="{Binding Path=SetEnv.VKPOS}" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions> 
        <WrapPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=销售单}}"/>
                <TextBox Grid.Column="1" Text="{Binding KRS}" Width="40"/>
                <TextBox Grid.Column="2" Text="{Binding LFD}" Width="80"/>
            </Grid>
        </WrapPanel>
        <DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                AutoGenerateColumns="False" EnableRowVirtualization="False" 
                  Name="dlgVKP"
                       ItemsSource="{Binding Source={StaticResource ResourceKey=vwVKPOS}}"
                       HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                 
                <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="" Width="Auto" MinWidth="20" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="销售单" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header=" " Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="纱线" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=gb2312}}" Header="色号" Width="Auto"   />
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="数量" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="留位" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="预留" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="交期" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="创建日期" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="跟单" Width="Auto" MinWidth="30" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
